﻿<div id="login" class="float-right">

    @if (Request.IsAuthenticated) {
        <div class="authenticated">
            <div class="user-icon float-left"></div>
            @Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })
            @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {
                @Html.AntiForgeryToken()
                <a href="javascript:document.getElementById('logoutForm').submit()">Thoát</a>
            }
        </div>
    } else {    
        <div class="anonymous">
            @Html.ActionLink("Đăng ký tài khoản", "Register", "Account", null, new { id = "ref-register" })
            @Html.ActionLink("Đăng nhập", "Login", "Account", null, new { id= "ref-login" })
        </div>
    }

</div>